.class public Lcom/snowplowanalytics/snowplow/tracker/Subject;
.super Ljava/lang/Object;


# static fields
.field private static TAG:Ljava/lang/String;


# instance fields
.field private standardPairs:Ljava/util/HashMap;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    const-class v0, Lcom/snowplowanalytics/snowplow/tracker/Subject;

    invoke-virtual {v0}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v0

    sput-object v0, Lcom/snowplowanalytics/snowplow/tracker/Subject;->TAG:Ljava/lang/String;

    return-void
.end method

.method private constructor <init>(Lcom/snowplowanalytics/snowplow/tracker/Subject$SubjectBuilder;)V
    .locals 3

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    iput-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/Subject;->standardPairs:Ljava/util/HashMap;

    invoke-direct {p0}, Lcom/snowplowanalytics/snowplow/tracker/Subject;->setDefaultTimezone()V

    invoke-direct {p0}, Lcom/snowplowanalytics/snowplow/tracker/Subject;->setDefaultLanguage()V

    # getter for: Lcom/snowplowanalytics/snowplow/tracker/Subject$SubjectBuilder;->context:Landroid/content/Context;
    invoke-static {p1}, Lcom/snowplowanalytics/snowplow/tracker/Subject$SubjectBuilder;->access$100(Lcom/snowplowanalytics/snowplow/tracker/Subject$SubjectBuilder;)Landroid/content/Context;

    move-result-object v0

    if-eqz v0, :cond_0

    # getter for: Lcom/snowplowanalytics/snowplow/tracker/Subject$SubjectBuilder;->context:Landroid/content/Context;
    invoke-static {p1}, Lcom/snowplowanalytics/snowplow/tracker/Subject$SubjectBuilder;->access$100(Lcom/snowplowanalytics/snowplow/tracker/Subject$SubjectBuilder;)Landroid/content/Context;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/snowplowanalytics/snowplow/tracker/Subject;->setDefaultScreenResolution(Landroid/content/Context;)V

    :cond_0
    sget-object v0, Lcom/snowplowanalytics/snowplow/tracker/Subject;->TAG:Ljava/lang/String;

    const-string v1, "Subject created successfully."

    const/4 v2, 0x0

    new-array v2, v2, [Ljava/lang/Object;

    invoke-static {v0, v1, v2}, Lcom/snowplowanalytics/snowplow/tracker/utils/Logger;->v(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;)V

    return-void
.end method

.method synthetic constructor <init>(Lcom/snowplowanalytics/snowplow/tracker/Subject$SubjectBuilder;Lcom/snowplowanalytics/snowplow/tracker/Subject$1;)V
    .locals 0

    invoke-direct {p0, p1}, Lcom/snowplowanalytics/snowplow/tracker/Subject;-><init>(Lcom/snowplowanalytics/snowplow/tracker/Subject$SubjectBuilder;)V

    return-void
.end method

.method private setDefaultLanguage()V
    .locals 1

    invoke-static {}, Ljava/util/Locale;->getDefault()Ljava/util/Locale;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/Locale;->getDisplayLanguage()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/snowplowanalytics/snowplow/tracker/Subject;->setLanguage(Ljava/lang/String;)V

    return-void
.end method

.method private setDefaultTimezone()V
    .locals 1

    invoke-static {}, Ljava/util/Calendar;->getInstance()Ljava/util/Calendar;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/Calendar;->getTimeZone()Ljava/util/TimeZone;

    move-result-object v0

    invoke-virtual {v0}, Ljava/util/TimeZone;->getID()Ljava/lang/String;

    move-result-object v0

    invoke-virtual {p0, v0}, Lcom/snowplowanalytics/snowplow/tracker/Subject;->setTimezone(Ljava/lang/String;)V

    return-void
.end method


# virtual methods
.method public getSubject()Ljava/util/Map;
    .locals 1

    iget-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/Subject;->standardPairs:Ljava/util/HashMap;

    return-object v0
.end method

.method public setColorDepth(I)V
    .locals 3

    iget-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/Subject;->standardPairs:Ljava/util/HashMap;

    const-string v1, "cd"

    invoke-static {p1}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    return-void
.end method

.method public setDefaultScreenResolution(Landroid/content/Context;)V
    .locals 4

    const-string v0, "window"

    invoke-virtual {p1, v0}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/view/WindowManager;

    invoke-interface {v0}, Landroid/view/WindowManager;->getDefaultDisplay()Landroid/view/Display;

    move-result-object v0

    new-instance v1, Landroid/graphics/Point;

    invoke-direct {v1}, Landroid/graphics/Point;-><init>()V

    sget v2, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v3, 0xd

    if-lt v2, v3, :cond_0

    invoke-virtual {v0, v1}, Landroid/view/Display;->getSize(Landroid/graphics/Point;)V

    iget v0, v1, Landroid/graphics/Point;->x:I

    iget v1, v1, Landroid/graphics/Point;->y:I

    invoke-virtual {p0, v0, v1}, Lcom/snowplowanalytics/snowplow/tracker/Subject;->setScreenResolution(II)V

    :goto_0
    return-void

    :cond_0
    invoke-virtual {v0}, Landroid/view/Display;->getWidth()I

    move-result v1

    invoke-virtual {v0}, Landroid/view/Display;->getHeight()I

    move-result v0

    invoke-virtual {p0, v1, v0}, Lcom/snowplowanalytics/snowplow/tracker/Subject;->setScreenResolution(II)V

    goto :goto_0
.end method

.method public setDomainUserId(Ljava/lang/String;)V
    .locals 2

    iget-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/Subject;->standardPairs:Ljava/util/HashMap;

    const-string v1, "duid"

    invoke-virtual {v0, v1, p1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    return-void
.end method

.method public setIpAddress(Ljava/lang/String;)V
    .locals 2

    iget-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/Subject;->standardPairs:Ljava/util/HashMap;

    const-string v1, "ip"

    invoke-virtual {v0, v1, p1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    return-void
.end method

.method public setLanguage(Ljava/lang/String;)V
    .locals 2

    iget-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/Subject;->standardPairs:Ljava/util/HashMap;

    const-string v1, "lang"

    invoke-virtual {v0, v1, p1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    return-void
.end method

.method public setNetworkUserId(Ljava/lang/String;)V
    .locals 2

    iget-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/Subject;->standardPairs:Ljava/util/HashMap;

    const-string v1, "tnuid"

    invoke-virtual {v0, v1, p1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    return-void
.end method

.method public setScreenResolution(II)V
    .locals 3

    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-static {p1}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "x"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-static {p2}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    iget-object v1, p0, Lcom/snowplowanalytics/snowplow/tracker/Subject;->standardPairs:Ljava/util/HashMap;

    const-string v2, "res"

    invoke-virtual {v1, v2, v0}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    return-void
.end method

.method public setTimezone(Ljava/lang/String;)V
    .locals 2

    iget-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/Subject;->standardPairs:Ljava/util/HashMap;

    const-string v1, "tz"

    invoke-virtual {v0, v1, p1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    return-void
.end method

.method public setUserId(Ljava/lang/String;)V
    .locals 2

    iget-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/Subject;->standardPairs:Ljava/util/HashMap;

    const-string v1, "uid"

    invoke-virtual {v0, v1, p1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    return-void
.end method

.method public setUseragent(Ljava/lang/String;)V
    .locals 2

    iget-object v0, p0, Lcom/snowplowanalytics/snowplow/tracker/Subject;->standardPairs:Ljava/util/HashMap;

    const-string v1, "ua"

    invoke-virtual {v0, v1, p1}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    return-void
.end method

.method public setViewPort(II)V
    .locals 3

    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    invoke-static {p1}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, "x"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-static {p2}, Ljava/lang/Integer;->toString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    iget-object v1, p0, Lcom/snowplowanalytics/snowplow/tracker/Subject;->standardPairs:Ljava/util/HashMap;

    const-string v2, "vp"

    invoke-virtual {v1, v2, v0}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    return-void
.end method
